package com.thd.springboottest.sso.client.config;

import com.thd.springboottest.sso.client.filter.AuthFilter;
import com.thd.springboottest.sso.client.filter.NormalFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * com.thd.springboottest.sso.client.config.SsoClientConfiguration
 *
 * @author: wanglei62
 * @DATE: 2021/8/22 20:13
 **/
@Configuration
public class SsoClientConfiguration {
    @Bean
    public FilterRegistrationBean authFilter() {
        FilterRegistrationBean myFilter = new FilterRegistrationBean();
        myFilter.addUrlPatterns("/ssoclient/info/*");
        myFilter.setFilter(new AuthFilter());
        return myFilter;
    }

    @Bean
    public FilterRegistrationBean normalFilter() {
        FilterRegistrationBean myFilter = new FilterRegistrationBean();
        myFilter.addUrlPatterns("/ssoclient/*");
        myFilter.setFilter(new NormalFilter());
        return myFilter;
    }

}
